// pages/workOrder/processDetail/index.js
import requestUtil from '../../../baseRequest.js'
import urls from '../../../requestUrl.js'

Page({

    /**
     * 页面的初始数据
     */
    data: {
        components: []
    },

    /**获取表单组件列表信息 */
    getFormComponentsList() {
        let param = {
            "workOrderProcess": this.data.process,
            "workOrderId": this.data.orderId
        }
        requestUtil.postRequest(urls.workOrder.getFormDetail, param, (res) => {
            this.setData({
                components: res,

            })
        }, () => {})
    },
    /**查看五方位图 */
    toVehicleStatusPage(e) {
        let d = e.currentTarget.dataset
        getApp().saveVehicleStatus(d.name, d.value)
        wx.navigateTo({
            url: `/pages/vehicleStatus/index?name=${d.name}&disabled=true`
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        this.data.process = options.process || '0'
        this.setData({
            orderId: options.orderId || 'dfb9fd1df3dc4fd1b141825efaa07137'
        })
        this.getFormComponentsList()
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    }
})